package com.DateDemo;

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

/**
 * @Author milian
 * @Date 2021/7/22 0022 20:06
 */
public class test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入出生年月");
        String s = sc.nextLine();
        LocalDate now = LocalDateTime.now().toLocalDate();
        DateTimeFormatter dtf =  DateTimeFormatter.ofPattern("yyyy-M-dd");
        LocalDate birthDay = LocalDate.parse(s, dtf);
        Duration between = Duration.between(now, birthDay);
        System.out.println(between.toDays());
    }
}
